package com.zzyl.nursing.controller;

import com.zzyl.common.annotation.Log;
import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.core.domain.R;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.common.enums.BusinessType;
import com.zzyl.common.utils.poi.ExcelUtil;
import com.zzyl.nursing.domain.AlertData;
import com.zzyl.nursing.dto.AlertDataPageQueryDto;
import com.zzyl.nursing.dto.HandleAlertDataDto;
import com.zzyl.nursing.service.IAlertDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 报警数据Controller
 *
 * @author Zhy
 * @date 2025-03-11
 */
@Api(tags = "报警数据管理")
@RestController
@RequestMapping("/nursing/alertData")
@RequiredArgsConstructor
public class AlertDataController extends BaseController {

	private final IAlertDataService alertDataService;


	//2.1.1 分页查询报警数据
	@GetMapping("/list")
	public TableDataInfo list(AlertDataPageQueryDto alertDataPageQueryDto) {
		startPage();
		List<AlertData> list = alertDataService.pageQueryAlertData(alertDataPageQueryDto);
		return getDataTable(list);
	}
	//2.1.2 处理设备报警数据
	@PutMapping("/handleAlertData")
	public  AjaxResult handleAlertData(@RequestBody HandleAlertDataDto handleAlertDataDto) {
		alertDataService.handleAlertData(handleAlertDataDto);
		return AjaxResult.success();
	}
}
